package com.changpay.zywy.adapter

import android.content.Context
import android.text.TextUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.changpay.zywy.R
import com.changpay.zywy.bean.TiXianMessageBean

/**
 * Created by chenxz on 2018/4/22.
 */
class TixianMessageAdapter(private val context: Context?, datas: MutableList<TiXianMessageBean>) :
    BaseQuickAdapter<TiXianMessageBean, BaseViewHolder>(R.layout.item_tixian_message, datas) {

    override fun convert(helper: BaseViewHolder?, item: TiXianMessageBean?) {
        item ?: return
        helper ?: return
        helper.setText(R.id.tv_title, item.pdc_payment_state)
            .setText(R.id.tv_money, "¥${item.pdc_amount}")
            .setText(R.id.tv_ti_xian_time, "${item.pdc_addtime}")
            .setText(R.id.tv_yin_hang, item.pdc_bank_name)
        if (TextUtils.isEmpty(item.pdc_payment_time))
        {
            helper.setText(R.id.tv_dao_zhang_time,item.pdc_expect_time)
        }else
        {
            helper.setText(R.id.tv_dao_zhang_time,item.pdc_payment_time)
        }
    }

}
